package jwxx.server;

import java.sql.ResultSet;
import java.sql.SQLException;

public class LoginSql {
	private ResultSet rs;
	public SAttribute search(String name)throws SQLException{
		String sql3 = "select * from attribute_table where name='"+name+"'";	
		DbOperator db2 = new DbOperator();		
		SAttribute newplay=new SAttribute();

		try{
			rs = db2.executeQuery(sql3, new Object[]{});
			while(rs.next()){
				newplay.setID(rs.getInt("id"));
				newplay.setSign(rs.getString("sign"));
				newplay.setNickName(rs.getString("nickname"));
				newplay.setLocalX(rs.getInt("local_position_x"));
				newplay.setLocalY(rs.getInt("local_position_y"));
				newplay.setName(rs.getString("name"));
				newplay.setSex(rs.getBoolean("sex"));				
				newplay.setPicID(rs.getInt("pic_id"));		
				newplay.setAccount(true);
			}
		}catch(SQLException e){
			e.printStackTrace();
		}			
		
		db2.close();
		return newplay;
	}	

	}					
	


